<!DOCTYPE html>
<html lang="en" ng-app="AldeasInfantiles">
<head>
  <title>Aldeas Infantiles | Administrar Art&iacute;culos</title>
  <?php
	  $this->load->view('head_view');
  ?>
  <script src="<?php echo base_url("assets/js/articles-view.js"); ?>"></script>
  <script src="<?php echo base_url("assets/js/angular-file-upload.js"); ?>"></script>
  <script src="<?php echo base_url("assets/js/menu-view.js"); ?>"></script>
</head>
<body>
  <div class="container">
    <div class="masthead">
      <?php
        $this->load->view('nav_view');
      ?>
    </div>
    <div class="jumbotron" ng-controller="Articles">
        


        <div class="panel-group" id="accordion">
           <div class="panel panel-primary">
           
                <div class="panel-heading">
                    <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#accordionOne">
                      Editar Art&iacute;culos
                    </a>
                   </h4>
                </div>
            
                <div id="accordionOne" class="panel-collapse collapse in">
                  <div class="panel-body">
                    <form class="form-horizontal" role="form" id="form-edit-article" >
                      <h4>Editar Articulos <span class="glyphicon glyphicon-cutlery"></span></h4>
                      <div class="row">
                        <div class="col-xs-4">
                          <label for="add-article-search" class="col-sm-12 control-label">Buscar:</label>
                        </div>
                        <div class="col-xs-8">
                          <a href="#" data-toggle="modal" data-target="#modal-articles" ng-click="showArticles()"><span class="glyphicon glyphicon-search"></span> Buscar</a>
                        </div>
                      </div>
                      <div class="row hide">
                        <div class="col-xs-4">
                          <label for="article.articleid" class="col-sm-12 control-label">Identificador:</label>
                        </div>
                        <div class="col-xs-8">
                          <input type="text" class="form-control" ng-model="article.articleid" id="article.articleid" name="articleid" disabled>
                        </div>
                      </div>
                      <div class="row">
                        <div class="col-xs-4">
                          <label for="articlename" class="col-sm-12 control-label">Nombre:</label>
                        </div>
                        <div class="col-xs-8">
                          <input type="text" class="form-control" ng-model="article.articlename" id="article.articlename" name="articlename" placeholder="Nombre" required>
                        </div>
                      </div>
                      <div class="row">
                        <div class="col-xs-4">
                          <label for="selectedtype" class="col-sm-12 control-label">Categor&iacute;a:</label>
                        </div>
                        <div class="col-xs-8">
                          <select id="selectedtype" name="selectedtype" class="form-control" title="Seleccione la categor&iacute;a del art&iacute;culo"
                            ng-model="selectedtype"
                            ng-options="type.id_articulotipo as type.ds_articulotipo for type in articlesTypes">
                          </select>
                        </div>
                      </div>
                      <div class="row">
                        <div class="col-xs-4">
                          <label for="article.description" class="col-sm-12 control-label">Descripci&oacute;n:</label>
                        </div>
                        <div class="col-xs-8">
                          <textarea rows="2" cols="30" class="form-control" ng-model="article.description" id="article.description" name="description" title="Escriba la descripci&oacute;n del art&iacute;culo">
                          </textarea>
                        </div>
                      </div>
                      <div class="row">
                        <div class="col-xs-4">
                          <label for="article.features" class="col-sm-12 control-label">Caracter&iacute;sticas:</label>
                        </div>
                        <div class="col-xs-8">
                          <textarea rows="2" cols="30" class="form-control" ng-model="article.features" id="article.features" name="features" title="Escriba las caracter&iacute;sticas del art&iacute;culo">
                          </textarea>
                        </div>
                      </div>
                      <div class="row">
                        <div class="col-xs-4">
                          <label for="article.comments" class="col-sm-12 control-label">Comentarios:</label>
                        </div>
                        <div class="col-xs-8">
                          <textarea rows="2" cols="30" class="form-control" ng-model="article.comments" id="article.comments" name="comments" title="Escriba los comentarios del art&iacute;culo">
                          </textarea>
                        </div>
                      </div>
                      <div class="row">
                        <div class="col-xs-8">

                        </div>
                        <div class="col-xs-4">
                          <input type="reset" class="btn btn-default" value="Cancelar"  />
                          <input type="submit" class="btn btn-primary" value="Guardar" ng-click="saveArticle(article)"/>
                        </div>
                      </div>
                  </form>
                  </div>
                </div>
          </div>
          
           <div class="panel panel-primary">
            
                  <div class="panel-heading">
                  <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#accordionTwo">
                      Editar tipos de Art&iacute;culos
                    </a>
                  </h4>
                  </div>
             
                <div id="accordionTwo" class="panel-collapse collapse">
                  <div class="panel-body">
                    <form class="form-horizontal" role="form" id="form-edit-article-type">
                      <h4>Editar tipos de Art&iacute;culos <span class="glyphicon glyphicon-cutlery"></span></h4>
                      <div class="row">
                        <div class="col-xs-4">
                          <label for="add-article-search" class="col-sm-12 control-label">Buscar:</label>
                        </div>
                        <div class="col-xs-8">
                          <a href="#" data-toggle="modal" data-target="#modal-articles-types" ng-click="showArticlesTypes()"><span class="glyphicon glyphicon-search"></span> Buscar</a>
                        </div>
                      </div>
                      <div class="row hide">
                        <div class="col-xs-4">
                          <label for="articletype.typeid" class="col-sm-12 control-label">Identificador:</label>
                        </div>
                        <div class="col-xs-8">
                          <input type="text" class="form-control" ng-model="articletype.typeid" id="articletype.typeid" name="articletype.typeid" disabled>
                        </div>
                      </div>
                      <div class="row">
                        <div class="col-xs-4">
                          <label for="articletype.articletypename" class="col-sm-12 control-label">Nombre Tipo:</label>
                        </div>
                        <div class="col-xs-8">
                          <input type="text" class="form-control" ng-model="articletype.articletypename" id="articletype.articletypename" name="articletype.articletypename" placeholder="Nombre" required>
                        </div>
                      </div>
                      <div class="row">
                        <div class="col-xs-8">
                        </div>
                        <div class="col-xs-4">
                          <input type="reset" class="btn btn-default" value="Cancelar"  />
                          <input type="submit" class="btn btn-primary" value="Guardar" ng-click="getParamsType(articletype)" />
                        </div>
                      </div>
                  </form>
                  </div>
                </div>
            
           </div>
            <div id="messages-users" class="alert alert-dismissable {{alertClass}} {{hiddenClass}}">
              <strong>Mensaje!</strong> <span id="message-text">{{errorMessage}}</span>
            </div>
         </div>
      
      <div class="modal fade" id="modal-articles" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title">Seleccione un artículo</h4>
          </div>
              <div class="modal-body">
          <form class="form-horizontal" role="form" id="user-form">
            <div class="row">
              <div class="col-xs-2">
                <h5>Filtrar:</h5>
              </div>
              <div class="col-xs-4">
                <input type="text" class="form-control" placeholder="Nombre del artículo" ng-model="query" id="userfilter" name="userfilter" value="" size="25" />
              </div>
            </div>
            <div class="list-group" role="navigation">
              <a ng-repeat="article in articles | filter:query" ng-click="getArticleById(article, $event)" href="" class="list-group-item">{{article.ds_articulo}}</a>
            </div>
          </form>
              </div>
            </div><!-- /.modal-content -->
          </div><!-- /.modal-dialog -->
      </div>
      <div class="modal fade" id="modal-articles-types" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title">Seleccione un tipo de artículo</h4>
          </div>
              <div class="modal-body">
          <form class="form-horizontal" role="form" id="user-form">
            <div class="row">
              <div class="col-xs-2">
                <h5>Filtrar:</h5>
              </div>
              <div class="col-xs-4">
                <input type="text" class="form-control" placeholder="Nombre del tipo" ng-model="querytype" id="querytype" name="querytype" value="" size="25" />
              </div>
            </div>
            <div class="list-group" role="navigation">
              <a ng-repeat="article in articlesTypesArray | filter:querytype" ng-click="getArticleTypeById(article, $event)" href="" class="list-group-item">{{article.ds_articulotipo}}</a>
            </div>
          </form>
              </div>
            </div><!-- /.modal-content -->
          </div><!-- /.modal-dialog -->
      </div>
    </div>
    <?php
      $this->load->view('footer_view');
    ?>
  </div>
</body>
</html>